import {createRouter, createWebHistory} from "vue-router";

const route = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'home',
            component: () => import('../views/layout/index.vue'),
            redirect: '/index', // 重定向到index页面
            children: [
                {
                    path: '/index',
                    name: 'index',
                    component: () => import('../views/index/index.vue')
                },
                {
                    path: '/clazz',
                    name: 'clazz',
                    component: () => import('../views/clazz/index.vue')
                },
                {
                    path: '/log',
                    name: 'log',
                    component: () => import('../views/log/index.vue')
                },
                {
                    path: '/dept',
                    name: 'dept',
                    component: () => import('../views/dept/index.vue')
                },
                {
                    path: '/stuReport',
                    name: 'stuReport',
                    component: () => import('../views/stuReport/index.vue')
                },
                {
                    path: '/empReport',
                    name: 'empReport',
                    component: () => import('../views/empReport/index.vue')
                },
                {
                    path: '/stu',
                    name: 'stu',
                    component: () => import('../views/stu/index.vue')
                },
                {
                    path: '/emp',
                    name: 'emp',
                    component: () => import('../views/emp/index.vue')
                },
                {
                    path: '/userRule',
                    name: 'userRule',
                    component: () => import('../views/userRule/index.vue')
                }
            ]
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('../views/login/index.vue')
        }
    ]
})

export default route;
